<?php
return[
    //控制器通用配置
    //只有validate这个是 两个都验证、且Common验证通过后验证子类。
    //其他的配置均为子类覆盖common，common覆盖内置默认配置。（action>controller>module）;
    //配置表的action部分小驼峰部分写成小写即可
    'common'=>[
        'method'=> ['GET', 'POST', 'PUT', 'DELETE'],
        'is_cross'=>0, //是否允许跨域
        'is_login'=> ['create'=>0,'update'=>0,'read'=>0,'delete'=>0], //权限
        'table'=>'admin',
        'field'=>['admin_password'],
        'is_log'=>1,
    ],
    'loginsend'=>[
        'validate'=>[
            'rule' => [
                'admin_account' => ['require','max'=>20],
                'admin_password'=>['require','max'=>20],
                'vercode'=>'require|captcha',
            ],
            'message' =>[
                'admin_account.require'=>'请输入账号！',
                'admin_account.max'=>'账号太长！',
                'admin_password.require'=>'请输入密码！',
                'admin_password.max'=>'密码太长！',
                'vercode.require'=>'请输入验证码！',
                'vercode.captcha'=>'验证码不正确！',
            ],
        ],
        'method'=> ['POST']
    ],
    'regsend'=>[
        'validate'=>[
            'rule'=>[
                'admin_account' => ['require','max'=>15],
                'admin_sex'=>['require'],
                'admin_nickname' =>['require','max'=>15],
                'admin_password' =>['require','max'=>15],
                'admin_password_sure'=>'require|confirm:admin_password',
                'admin_phone' => ['require'],
                'invitation' => ['require'],
                'vercode' => 'require|captcha'
            ],
            'message'=>[
                'admin_account.require' => '请输入账号！',
                'admin_account.max' => '账号太长！',
                'admin_sex.require' => '请输入性别！',
                'admin_nickname.require' => '请输入用户名！',
                'admin_nickname.max' => '用户名太长！',
                'admin_password.require' => '请输入密码！',
                'admin_password.max' => '密码太长!',
                'admin_password_sure.require' => '请输入确认密码！',
                'admin_password_sure.confirm' => '密码和确认密码一致！',
                'admin_phone.require' => '请输入手机号!',
                'invitation.require' => '请输入邀请码',
                'vercode.require'=>'请输入验证码！',
                'vercode.captcha'=>'验证码不正确！',
            ],
            'method'=> ['POST']
        ]
    ]

];